/* 
 *	Copyright (C) 2009-2010 miaohua
 *	http://code.google.com/p/lrcshower/
 *
 *  This Program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *   
 *  This Program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *   
 *  You should have received a copy of the GNU General Public License
 *  along with GNU Make; see the file COPYING.  If not, write to
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */

#include "stdafx.h"
#include "MusicBox.h"
#include "CreatePLDlg.h"
#include "MFCHelperFuncs.h"


// CCreatePLDlg dialog

IMPLEMENT_DYNAMIC(CCreatePLDlg, CDialog)

CCreatePLDlg::CCreatePLDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CCreatePLDlg::IDD, pParent)
    , m_PLName(_T(""))
{
}

CCreatePLDlg::~CCreatePLDlg()
{
}

void CCreatePLDlg::DoDataExchange(CDataExchange* pDX)
{
     CDialog::DoDataExchange(pDX);
     DDX_Text(pDX, IDC_PL_NAME, m_PLName);
}


BEGIN_MESSAGE_MAP(CCreatePLDlg, CDialog)
     ON_BN_CLICKED(ID_CANCEL, &CCreatePLDlg::OnBnClickedCancel)
     ON_BN_CLICKED(ID_SAVE_PL, &CCreatePLDlg::OnBnClickedSavePl)
END_MESSAGE_MAP()


// CCreatePLDlg message handlers

void CCreatePLDlg::OnBnClickedCancel()
{
     EndDialog(IDCANCEL);
}

void CCreatePLDlg::OnBnClickedSavePl()
{
     UpdateData(TRUE);
     if( m_PLName.Trim().IsEmpty() )
     {
         Msg_Prompt(IDS_PLNAME_ERR_TIP, MB_OK|MB_ICONERROR|MB_APPLMODAL);
         return;
     }
     EndDialog(IDOK);
}


CString CCreatePLDlg::GetPLName()
{
     return m_PLName;
}
